package cz.muni.fi.pa165.library.api;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Marian Labuda
 * @version 1.0
 */
public class ReservationTO implements Serializable {

    private static final long serialVersionUID = 359322L;
    private Long reservationID;
    private ReaderTO readerTO;
    private BookTO bookTO;
    private Date reservationDate;

    public ReservationTO() {
    }

    public ReservationTO(ReaderTO readerTO, BookTO bookTO, Date reservationDate) {
        this.readerTO = readerTO;
        this.bookTO = bookTO;
        this.reservationDate = reservationDate;
    }

    public ReservationTO(Long id, ReaderTO readerTO, BookTO bookTO, Date reservationDate) {
        this(readerTO, bookTO, reservationDate);
        this.reservationID = id;
    }

    public Long getReservationID() {
        return reservationID;
    }

    public void setReservationID(Long reservationID) {
        this.reservationID = reservationID;
    }

    public ReaderTO getReaderTO() {
        return readerTO;
    }

    public void setReaderTO(ReaderTO readerTO) {
        this.readerTO = readerTO;
    }

    public BookTO getBookTO() {
        return bookTO;
    }

    public void setBookTO(BookTO bookTO) {
        this.bookTO = bookTO;
    }

    public Date getReservationDate() {
        return reservationDate;
    }

    public void setReservationDate(Date reservationDate) {
        this.reservationDate = reservationDate;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 67 * hash + (this.readerTO != null ? this.readerTO.hashCode() : 0);
        hash = 67 * hash + (this.bookTO != null ? this.bookTO.hashCode() : 0);
        hash = 67 * hash + (this.reservationDate != null ? this.reservationDate.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof ReservationTO)) {
            return false;
        }
        ReservationTO other = (ReservationTO) object;
        if ((this.reservationID == null) || (this.reservationID != null && !this.reservationID.equals(other.reservationID))) {
            return false;
        }
        return true;
    }
}
